Skip to content

Conversation

@dwalluck
Copy link
Contributor

@dwalluck dwalluck commented Feb 19, 2025

The return type of the method PackageURLBuilder::getQualifiers should be an interface, such as Map, rather than the implementation TreeMap. This aligns with the return type of the method
PackageURL::getQualifiers.

Also, make the return types of this method match the return types of
PackageURL::getQualifiers.

Note that this a potentially breaking API change.

The return type of the method `PackageURLBuilder::getQualifiers` should
be an interface, such as `Map`, rather than the implementation `TreeMap`.
This aligns with the return type of the method
`PackageURL::getQualifiers`.

Also, make the return types of this method match the return types of
`PackageURL::getQualifiers`.

Note that this a potentially breaking API change.
@dwalluck dwalluck force-pushed the package-url-builder-get-qualifiers branch from d72ecba to cba13d5 Compare February 20, 2025 14:21
@dwalluck
Copy link
Contributor Author

Note that it is considered better practice to have PackageURL::getQualifiers return an empty map instead of null, but this keeps the original behavior. Whether to return an unmodifiable view or a copy is a choice, although the former is more efficient and keeps the original behavior.

Copy link
Collaborator

@jeremylong jeremylong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeremylong jeremylong merged commit ed3a681 into package-url:master Mar 11, 2025
2 checks passed
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
@dwalluck dwalluck deleted the package-url-builder-get-qualifiers branch March 11, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants